﻿
(function ($) {
    app.modals.CreateOrEditANDONModal = function () {

        var _modalManager;

        var _aNDONService = abp.services.app.aNDON;

		
        var _$aNDONInformationForm = null;


        this.init = function (modalManager) {
            _modalManager = modalManager;
            _$aNDONInformationForm = _modalManager.getModal().find("form[name=aNDONInformationsForm]");




        }
        
        this.save = function () {
           
            //校验通过

            var aNDON = _$aNDONInformationForm.serializeFormToObject();
          //  console.log(aNDON);

            _modalManager.setBusy(true);

            _aNDONService.createOrUpdateANDONAsync({
                aNDONEditDto: aNDON
            }).done(function () {
                //提示信息
                abp.notify.info(app.localize('SavedSuccessfully'));
                //关闭窗体
                _modalManager.close();
                //信息保存成功后调用事件，刷新列表
                abp.event.trigger('app.createOrEditANDONModalSaved');
            }).always(function () {
                _modalManager.setBusy(false);
            });
        }
       
    }
})(jQuery);

   